Reprint Please specify Source: http://blog.csdn.net/luotuo44/article/details/39374759This article mainly deals with Linux time types, time functions, and sleep functions provided by Linux.the time type and the corresponding function:time_t:The most
Description: function name: SleepFunction: Execution hangs for a period of timeUsage: unsigned sleep (unsigned seconds);Using the top file in VC#include In the GCC compiler, the header file used differs depending on the GCC versionThe header files
Directory(i) causes (ii) hybrid spin lock (iii) q3.h and Ringbuffer (d) ringqueue (upper) spin lock (v) The Art of Ringqueue (middle) Sleep OpeningI have studied disruptor these days. NET version, due to. NET version follow-up, online only v2.10
Introduction:
Function Name: Sleep
Function: the execution is suspended for a period of time.
Usage: Unsigned sleep (unsigned seconds );
Use the header file in VC
# Include
In the GCC compiler, the header file used varies with the GCC
Recently, for Linux development on arm, C Programs Written in windows need to be transplanted to Linux. The underlying SPI driver implementation and socket communication on the upper layer need to be rewritten, the application also needs to be
Sleep function in C Language
Sleep function:
Function: the execution is suspended for a period of time.
Usage: unsigned sleep (unsigned seconds );
Note:
Use the header file # include in VC. in Linux, the header file used by the gcc compiler varies
1:sleep ()The minimum unit of seconds.When using Sleep/ulseep/select, because the thread will go to sleep state, and then wake up, if the single execution problem is not small, if the number of cycles executed more, then the difference is very large.
The C standard contains a sleep to implement the current thread to suspend execution for n milliseconds, as follows:Function Name: SleepFunction: Execution hangs for a period of timeUsage: unsigned sleep (unsigned seconds); Need to bring the top
Previous code to get the current system time.
You can obtain the system time by checking the time () on the network. If you find any problem, you can only obtain the system time in seconds.
Then I found the following article:
========================
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.